<!doctype html>
<html lang="en">

<head>
	<meta charset="utf-8" />
	<title>脚标机监控记录</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />

	<!-- App favicon -->
	<link rel="shortcut icon" href="assets/images/favicon.ico">
	<!-- layui日期插件样式 -->
	<link rel="stylesheet" type="text/css" href="plugins/layui2/css/layui.css" />

	<!-- App css -->
	<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
	<link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css" />
	<link href="assets/css/style.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="assets/css/custom.css" />
	<!-- layer插件 -->
	<link rel="stylesheet" type="text/css" href="plugins/layer2.4/skin/layer.css" />

	<!-- bootstrap-select -->
	<link rel="stylesheet" type="text/css" href="plugins/bootstrap-select/css/bootstrap-select.min.css" />

	<script src="assets/js/modernizr.min.js"></script>

</head>

<body>

	<!-- Begin page -->
	<div id="wrapper">

		<!-- ============================================================== -->
		<!-- 页面内容开始 -->
		<!-- ============================================================== -->

		<!-- Start Page content -->
		<div class="my-content">
			<div class="container-fluid">
				<div class="row">
					<div class="col-md-12">
						<div class="card-box">
							<h4 class="m-t-0 m-b-30 header-title">脚标机监控记录</h4>

							<form class="form-horizontal" role="form">
								<div class="form-group row">
									<label for="barcodeMachineId" class="col-3 col-form-label">脚标机编号</label>
									<div class="col-9">
										<input type="text" class="form-control" id="barcodeMachineId"
											name="barcodeMachineId" placeholder="脚标机编号">
									</div>
								</div>
								<div class="form-group row">
									<label for="loginDate" class="col-3 col-form-label">登录时间</label>
									<div class="col-9">
										<input type="text" class="form-control" id="loginDate" name="loginDate"
											placeholder="登录时间">
									</div>
								</div>
								<div class="form-group row">
									<label for="state" class="col-3 col-form-label">在线状态</label>
									<div class="col-9">
										<select class="selectpicker form-control" id="state" name="state" title="在线状态"
											data-hide-disabled="ture" data-actions-box="true">
											<option value="0">离线</option>
											<option value="1">正常</option>
											<option value="2">卡纸</option>
											<option value="3">缺纸</option>
										</select>
									</div>
								</div>
								<div class="form-group row">
									<label for="barcodeSurplus" class="col-3 col-form-label">条码剩余数量</label>
									<div class="col-9">
										<input type="text" class="form-control" id="barcodeSurplus"
											name="barcodeSurplus" placeholder="条码剩余数量">
									</div>
								</div>
								<!-- <div class="form-group row">
									<label for="threshold" class="col-3 col-form-label">条码剩余数量阈值</label>
									<div class="col-9">
										<input type="text" class="form-control" id="threshold" name="threshold"
											placeholder="条码剩余数量阈值">
									</div>
								</div> -->
								<div class="form-group row">
									<label for="userId" class="col-3 col-form-label">用户</label>
									<div class="col-9">
										<input type="text" class="form-control" id="userId" name="userId"
											placeholder="用户">
									</div>
								</div>
								<div class="form-group row">
									<label for="offlineTime" class="col-3 col-form-label">下线时间</label>
									<div class="col-9">
										<input type="text" class="form-control" id="offlineTime" name="offlineTime"
											placeholder="下线时间">
									</div>
								</div>
								<div class="form-group row">
									<label for="createBy" class="col-3 col-form-label">创建者</label>
									<div class="col-9">
										<input type="text" class="form-control" id="createBy" name="createBy"
											placeholder="创建者">
									</div>
								</div>
								<div class="form-group mb-0 justify-content-end row">
									<div class="col-9">
										<button type="submit" class="btn btn-primary waves-effect">提交</button>
										<button type="button" onclick="layer_close()"
											class="btn btn-danger waves-effect">关闭</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>

			</div>
			<!-- container -->

		</div>

		<!-- ============================================================== -->
		<!-- End Right content here -->
		<!-- ============================================================== -->

	</div>
	<!-- END wrapper -->

	<!-- jQuery  -->
	<script src="assets/js/jquery.min.js"></script>
	<script src="assets/js/bootstrap.bundle.min.js"></script>
	<script src="assets/js/metisMenu.min.js"></script>
	<script src="assets/js/waves.js"></script>
	<script src="assets/js/jquery.slimscroll.js"></script>

	<!-- App js -->
	<script src="assets/js/custom.js" type="text/javascript" charset="utf-8"></script>
	<script src="assets/js/jquery.core.js"></script>
	<script src="assets/js/jquery.app.js"></script>
	<script src="assets/js/custom.js" type="text/javascript" charset="utf-8"></script>

	<!-- 表单验证 -->
	<script src="plugins/jquery.form.js/jquery.form.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="plugins/jquery.validation.1.14.0/jquery.validate.js" type="text/javascript" charset="utf-8"></script>
	<script src="plugins/jquery.validation.1.14.0/validate-methods.js" type="text/javascript" charset="utf-8"></script>
	<script src="plugins/jquery.validation.1.14.0/messages_zh.js" type="text/javascript" charset="utf-8"></script>
	<!-- bootstrap-select -->
	<script src="plugins/bootstrap-select/js/bootstrap-select.js" type="text/javascript" charset="utf-8"></script>

	<!-- layer插件 -->
	<script src="plugins/layer2.4/layer.js" type="text/javascript" charset="utf-8"></script>
	<!-- layui的日期插件 -->
	<script src="plugins/layui2/layui.js" type="text/javascript" charset="utf-8"></script>

	<!-- datatables插件 -->
	<script type="text/javascript">
		layui.use('laydate', function () {
			var laydate = layui.laydate;

			//执行一个laydate实例
			laydate.render({
				elem: '#grantDate' //指定元素
			});
		});
		$(function () {
			//表单验证
			$("form").validate({
				rules: {
					barcodeMachineId: {
						required: true
					},
					loginDate: {
						required: true,
					},
					state: {
						required: true,
						number: true
					},
					barcodeSurplus: {
						required: true,
						number: true
					},
					// threshold: {
					// 	required: true,
					// 	number: true
					// },
					userId: {
						required: true
					},
					offlineTime: {
						required: true,
					},
					createBy: {
						required: true,
					}
				},
				onkeyup: false,
				focusCleanup: true,
				success: "valid",
				submitHandler: function (form) {
					var userid = getCookie("userid");
					var index = parent.layer.getFrameIndex(window.name);
					$(form).ajaxSubmit({
						type: "GET",
						url: URL + "addBarcodeMachineStatus",
						data: {
							"createBy": userid
						},
						success: function (data) {
							parent.layer.msg('添加成功!', {
								icon: 1,
								time: 1000
							});
							setTimeout(function () {
								parent.$(".btn-refresh").click();
								parent.layer.close(index);
							}, 1000);

						},
						error: function (XMLHttpRequest, textStatus, errorThrown) {
							networkError(XMLHttpRequest, textStatus, errorThrown)
						}
					});
				}
			});
		});
	</script>

</body>

</html>